home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1998-07-06 | 2.5 KB | 101 lines |
- G4C
-
- ; Clock.g - see the Routines.guide for details on it's use.
- ; ============================================================
- ; Note - this gui has no window. The ListView below is used
- ; only as a database to keep gui names.
- ; ============================================================
-
- xListView 0 0 10 10 '' lvar '' 0 NUM
- GadID 1
-
- ; ============================================================
- ; Upon loading, we make sure that rexxmast is available, then
- ; we launch the rexx program that will set our variables and
- ; wake us up every minute, so we can notify all the guis that
- ; have asked to be notified.
- ; ============================================================
-
- xOnLoad gui
-
- ; look for arexx and if not found, launch it..
- ifexists port AREXX
- ; ok..
- else
- run 'rexxmast'
- wait port AREXX 50
- if $$retcode > 0
- ezreq 'Could not launch RexxMast!' Quit ''
- guiquit clock.gc
- stop
- endif
- endif
-
- ; register the gui they sent us
- gosub clock.g add $gui
-
- ; Load the Clock.rexx program which is kept in the rexx dir
- sendrexx AREXX 'Guis:tools/rexx/Clock.rexx clock.g update'
-
-
- ; ============================================================
- ; On re-loading - add the gui..
- ; ============================================================
-
- xONRELOAD gui
- gosub clock.g add $gui
-
-
- ; ============================================================
- ; This is the routine that the rexx program we launched will
- ; call every minute, after it has set our variables.
- ; We, in turn, call all the guis that have asked us to.
- ; ============================================================
-
- XRoutine update
- lvuse clock.g 1
- if $$lv.total = 0 ; no guis - quit
- guiquit clock.g
- stop
- endif
- lvgo first
- while $$lv.line > ''
- GoSub $gui clock ; call the clock routine in all guis
- lvuse clock.g 1 ; because some other gui may change it
- lvgo next
- endwhile
-
-
- ; ============================================================
- ; Add a gui to the list
- ; ============================================================
-
- xROUTINE add gui
- if $gui > " "
- lvuse clock.g 1
- lvsearch $gui ci first
- if $$lv.line = "" ; add if it doesn't already exist
- lvadd '$gui'
- endif
- else
- ezreq "You MUST give a gui name" OK ''
- endif
-
-
- ; ============================================================
- ; Remove a gui
- ; ============================================================
-
- xROUTINE remove gui
- if $gui > ""
- lvuse clock.g 1
- lvsearch $gui ci first
- if $$lv.line > "" ; remove if it exists
- lvdel -1
- endif
- endif
-
-
-
-
-